<template>
    <div class="body">
        <div class="follow_main">
            <div class="follow_shop" v-for="item in AllList" :key="uid">
                <div class="new_top">
                    <div class="top_info">
                        <div class="top_info_left">
                            <img :src="item.shopHead" alt="">
                            <div class="message">
                                <p>{{ item.brand }}</p>
                                <span>￥0起送 | 配送费￥5 / 评价4.8分</span>
                                <span><i>减</i>{{ item.activity }}</span>
                            </div>

                        </div>
                        <div class="top_info_right">
                            <div class="shop" @click="InShop(item.id)">进入店铺&gt;</div>
                        </div>
                    </div>
                </div>
                <div class="new_bread">
                    <ul class="bread_mango">
                        <li v-for="mess in item.info">
                            <img :src="mess.productimg" alt="">
                            <p>{{ mess.product }}</p>
                            <span>￥{{ mess.price }}</span>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>
import router from '@/router'
import { ref, onMounted } from 'vue';
import { getFollowList } from '@/api/api'
import useZBStore from '@/pinia'
const useStore = useZBStore()
const AllList = ref([])
const initGetList = async () => {
    let { data } = await getFollowList()
    AllList.value = data
    console.log(data);
}

const InShop = (uid) => {
    router.push('/restaurantCard')
    console.log(uid);
    useStore.setUid(uid)
}

onMounted(() => {
    initGetList()
})
</script>

<style lang="scss" scoped>
* {
    margin: 0;
    padding: 0;
}


i {
    font-style: normal;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: scroll;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0px;
    height: 0px;
}

.body {
    background-color: #f6f6f6;
}

.follow_main {
    width: 100%;
    box-sizing: border-box;
    font-size: 28px;
    background-color: #fff;
    padding: 0 28px;

    .follow_shop {
        padding-bottom: 50px;
    }

    .new_top {
        width: 100%;
        padding: 0 10px;
        box-sizing: border-box;
        border-top: 1px solid #f3f3f3;
        padding-top: 30px;

        .top_info {
            display: flex;
            align-items: center;
            justify-content: space-between;

            .top_info_left {
                display: flex;
                line-height: 150%;
                justify-content: space-between;

                img {
                    width: 100px;
                    height: 100px;
                }

                span {
                    font-size: 22px;
                    color: rgba(166, 166, 166, 1);
                    line-height: 150%;
                    display: block;
                    margin-left: 5px;
                }

                i {
                    width: 28px;
                    height: 28px;
                    line-height: 28px;
                    border-radius: 16px;
                    background-color: #ff8d1a;
                    color: #fff;
                }
            }

            .top_info_right {
                .shop {
                    color: rgba(255, 141, 26, 1);
                }
            }
        }
    }

    .new_bread {
        color: #505050;

        h2 {
            font-size: 40px;
            height: 90px;
            line-height: 90px;
        }

        p {
            font-size: 23px;
            color: #a6a6a6;
        }

        .bread_mango::-webkit-scrollbar {
            display: none;
        }

        .bread_mango {
            display: flex;
            align-items: center;
            margin-top: 20px;
            overflow-x: auto;

            li {
                width: 200px;
                padding: 0 8px;

                img {
                    width: 200px;
                    height: 200px;
                    object-fit: cover;
                }

                p {
                    font-size: 22px;
                    margin-top: 20px;
                    margin-bottom: 20px;
                    color: #505050;
                }

                span {

                    font-size: 22px;
                    color: #505050;
                }
            }
        }
    }
}
</style>